﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.Web.UI.Controls;
using ZX.BLL.Extend;
using ZX.DBModule;
using ZX.TR.Bussiness;
using ZX.TR.Library;

namespace ZX.WebApp.TR
{
    public partial class MessageView :  BasePage
    {
        public string msgTitle = "";
        public string msgUrl = "";
        public string msgContent = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["msid"] != null)
            {
                ZX.TR.Library.V_TrMessageIssue tdw = new ZX.TR.Library.V_TrMessageIssue();
                BaseBussnies bbw = new BaseBussnies(tdw);
                IList<ZX.TR.Library.V_TrMessageIssue> ls = bbw.GetEntitys<ZX.TR.Library.V_TrMessageIssue>("TrMessageIssueID='" + Request.QueryString["msid"] + "'");
                if (ls != null)
                {
                    msgTitle = ls[0].IssueTitle;
                    msgContent = ls[0].Expain.Replace("\r\n","<p />");
                    msgUrl = ls[0].NetAddress;
                    if (msgUrl.Contains("http://") || msgUrl.Contains("https://"))
                    {
                        msgUrl = "<a title='" + msgTitle + "' target='_blank' href=" + msgUrl + " >" + msgUrl + "</a>";
                    }
                    else { msgUrl = "暂无有效链接"; }
                }
            }
        }
    }
}